package api

import form.ExchangeForm
import response.base.PageData
import response.base.Res
import response.item.ExchangeItem
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST

/**
 * 物品API
 * @author BX-Gin
 * @since 2024/6/6 下午2:12
 */

interface ItemApi {
    /**
     * 查询兑换物品列表
     * @return Call<Res<PageData<ExchangeItem>>>
     */
    @GET("$PREFIX/exchange_list")
    fun getExchangeList(): Call<Res<PageData<ExchangeItem>>>

    /**
     * 兑换物品
     * @param form ExchangeForm
     * @return Call<Res<Nothing>>
     */
    @POST("$PREFIX/exchange")
    fun postExchange(@Body form: ExchangeForm): Call<Res<Nothing>>

    companion object {
        const val PREFIX = "community/item"
    }
}